package com.example.demo.controller;

import com.example.demo.bean.APIResponseBean;
import com.example.demo.bean.APIResponseBeanUtil;
import com.example.demo.service.ChatMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class ChatMessageController {

    @Autowired
    private ChatMessageService chatMessageService;

    @GetMapping("/chat/sendMessage/{message}")
    public APIResponseBean<String> sendMessage(@PathVariable String message) {
        chatMessageService.sendMessage(message);
        return APIResponseBeanUtil.success(message);
    }
}
